﻿using System.Windows;
using System.Windows.Input;

namespace ServerCrafter.WPF
{
    /// <summary>
    /// Controls that are in the main window, but not in any tab.
    /// </summary>
    public partial class MainWindow
    {
        /// <summary>
        /// Handles the MouseLeftButtonDown event of the rectangleTitleBar control. Makes the form draggable.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
        private void rectangleTitleBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }

        /// <summary>
        /// Handles the MouseDown event of the btnMinimize control. Minimizes the window.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
        private void btnMinimize_MouseDown(object sender, MouseButtonEventArgs e)
        {
            WindowState = WindowState.Minimized;
        }

        /// <summary>
        /// Handles the MouseDown event of the btnExit control. Closes the window.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
        private void btnExit_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Application.Current.Shutdown();
        }
    }
}